﻿using Pattern20中介者模式.Base;
using Pattern20中介者模式.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pattern20中介者模式
{
    internal class Client
    {
        public void Start()
        {

            PlayerBase a = new APlayer("刘备", 100);
            PlayerBase b = new BPlayer("关羽", 100);
            PlayerBase c = new CPlayer("张飞", 100);
            a.Display();
            b.Display();
            c.Display();

            MediatorBase mediator = new Mediator(a, b,c);
            a.Win(mediator, 25);
            a.Display();
            b.Display();
            c.Display();

            b.Lose(mediator, 25);
            a.Display();
            b.Display();
            c.Display();

            Console.WriteLine("---------漂亮的分割线-----------");

             a = new Player("刘备", 100);
             b = new Player("关羽", 100);
             c = new Player("张飞", 100);
            a.Display();
            b.Display();
            c.Display();

            a.Win(b, c, 25);
            a.Display();
            b.Display();
            c.Display();

            b.Lose(a, c, 25);
            a.Display();
            b.Display();
            c.Display();
        }
    }
}
